UI: Use custom HTML elements for the UI Tag Input#11715
Conversation
2edf85d to
e3f8c43
Compare
thibsy
left a comment
There was a problem hiding this comment.
Hi @lscharmer,
Thx for providing this fix.
This is another good example of why the @yaiero/tagify library keeps causing friction. We repeatedly work around some issues or limitations to bend this library to all our needs, which keeps trading one problem for another and adds much unnecessary complexity. We should get rid of this library short-term.
For this PR specifically, please help me answer the following questions:
- Isn't there an existing element that supports all attributes the library needs? Maybe even an
<input type="hidden">(although this might be tricky due to name etc.)? - If I remember correctly, we originally moved to a
divbecause the custom HTML tag of the library was flagged during an A11Y inspection or some HTML-validator run (not entirely sure though). Would we not simply cause this issue again, since we embed a custom HTML tag of our own?
Thx for your insight.
Kind regards,
@thibsy (as UI coordinator)
|
Hi @thibsy,
I agree, AFAIK we also just need a fraction of the functionality the library provides.
The
No, because the problem with the tagify library is that they don't use valid custom elements. If I read this correctly they don't need to be defined with I also tested the custom elements with the W3C HTML Validator which was used for the failed TestRail Cases (at least for the linked Mantis Issues). No issues are reported with the custom elements (with a dash) + attributes. Best regards |
|
Hi @lscharmer, Thx a lot for the explanation. I was not aware of how custom HTML tags work exactly. From my POV there is no need to replace the one tag with a Let me know if I should integrate this as is. Kind regards, |
This PR fixes Mantis Bugs:
The library
@yaireo/tagifywhich is used for the UI Tag Input uses non existing HTML tags (e.g.<tags>,<tag>). We already replaced these with<div>'s instead but this results in invalid attributes used for our replacement tags (as reported in the Mantis issues above).This PR replaces the
<div>'s with custom HTML elements, so that this won't result in invalid HTML attributes anymore (https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements).